package com.ruoyi.imRank.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.imRank.mapper.IfmRankMapper;
import com.ruoyi.imRank.domain.IfmRank;
import com.ruoyi.imRank.service.IIfmRankService;

/**
 * 职级Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-01
 */
@Service
public class IfmRankServiceImpl implements IIfmRankService 
{
    @Autowired
    private IfmRankMapper ifmRankMapper;

    /**
     * 查询职级
     * 
     * @param rankId 职级主键
     * @return 职级
     */
    @Override
    public IfmRank selectIfmRankByRankId(Long rankId)
    {
        return ifmRankMapper.selectIfmRankByRankId(rankId);
    }

    /**
     * 查询职级列表
     * 
     * @param ifmRank 职级
     * @return 职级
     */
    @Override
    public List<IfmRank> selectIfmRankList(IfmRank ifmRank)
    {
        return ifmRankMapper.selectIfmRankList(ifmRank);
    }

    /**
     * 新增职级
     * 
     * @param ifmRank 职级
     * @return 结果
     */
    @Override
    public int insertIfmRank(IfmRank ifmRank)
    {
        ifmRank.setCreateTime(DateUtils.getNowDate());
        return ifmRankMapper.insertIfmRank(ifmRank);
    }

    /**
     * 修改职级
     * 
     * @param ifmRank 职级
     * @return 结果
     */
    @Override
    public int updateIfmRank(IfmRank ifmRank)
    {
        ifmRank.setUpdateTime(DateUtils.getNowDate());
        return ifmRankMapper.updateIfmRank(ifmRank);
    }

    /**
     * 批量删除职级
     * 
     * @param rankIds 需要删除的职级主键
     * @return 结果
     */
    @Override
    public int deleteIfmRankByRankIds(Long[] rankIds)
    {
        return ifmRankMapper.deleteIfmRankByRankIds(rankIds);
    }

    /**
     * 删除职级信息
     * 
     * @param rankId 职级主键
     * @return 结果
     */
    @Override
    public int deleteIfmRankByRankId(Long rankId)
    {
        return ifmRankMapper.deleteIfmRankByRankId(rankId);
    }
}
